#include <iostream>

using namespace std;

class Solution
{
public:
    int numJewelsInStones(string jewels, string stones)
    {
        int cnt = 0;
        for (auto J : jewels)
        {
            for (auto S : stones)
            {
                if (J == S)
                {
                    cnt++;
                }
            }
        }
        return cnt;
    }
};

int main()
{
    string jewels{ "aA" };
    string stones{ "aAAbbbb" };

    Solution xz;

    int n = xz.numJewelsInStones(jewels, stones);

    cout << n << endl;

	return 0;
}
